using System.Collections.Generic;

public class Table_AnimationItem
{
    /// <summary>
    /// 唯一ID
    /// <summary>
    public int Id { get; private set; }
    /// <summary>
    /// 动画名称
    /// <summary>
    public string AinmName { get; private set; }
    /// <summary>
    /// 优先级
    /// <summary>
    public int Layer { get; private set; }
    /// <summary>
    /// 播放模式1(1一次 2循环)
    /// <summary>
    public int WrapMode { get; private set; }
    /// <summary>
    /// 播放模式2
    /// <summary>
    public int PlayMode { get; private set; }
    /// <summary>
    /// 播放模式3
    /// <summary>
    public int QueueMode { get; private set; }
    /// <summary>
    /// 速度
    /// <summary>
    public float Speed { get; private set; }
    /// <summary>
    /// 过渡时间
    /// <summary>
    public float TransitTime { get; private set; }
    /// <summary>
    /// 循环次数
    /// <summary>
    public int LoopTime { get; private set; }
    /// <summary>
    /// 循环结束动作
    /// <summary>
    public int LoopOverAnimId { get; private set; }
    /// <summary>
    /// 是否能被打断
    /// <summary>
    public bool IsCanBreak { get; private set; }
    /// <summary>
    /// 结束后是否回调
    /// <summary>
    public bool IsCallEnd { get; private set; }
    /// <summary>
    /// 结束后的下一动作
    /// <summary>
    public int NextAnimId { get; private set; }
    /// <summary>
    /// 动作音效
    /// <summary>
    public int SoundId { get; private set; }

    public Table_AnimationItem(ExcelLineReader reader)
    {
        Id = reader.ReadInt();
        AinmName = reader.ReadString();
        Layer = reader.ReadInt();
        WrapMode = reader.ReadInt();
        PlayMode = reader.ReadInt();
        QueueMode = reader.ReadInt();
        Speed = reader.ReadFloat();
        TransitTime = reader.ReadFloat();
        LoopTime = reader.ReadInt();
        LoopOverAnimId = reader.ReadInt();
        IsCanBreak = reader.ReadBool();
        IsCallEnd = reader.ReadBool();
        NextAnimId = reader.ReadInt();
        SoundId = reader.ReadInt();
    }
}

public class Table_AnimationMgr : IDataMgr
{
    protected override string FileName { get { return "Txt/Animation.txt"; } }

    protected List<Table_AnimationItem> mItemList = new List<Table_AnimationItem>();
    public Table_AnimationItem GetItemByIdx(int idx)
    {
        return mItemList[idx];
    }
    public Table_AnimationItem GetItemById(int id)
    {
        int idx = GetIdxById(id);
        return GetItemByIdx(idx);
    }

    public override void Load(ExcelLineReader reader)
    {
        var item = new Table_AnimationItem(reader);
        mItemDic.Add(item.Id, mDataCount);
        mItemList.Add(item);
    }
}